import httpRequest from "@/utils/http-request.js";

/**
 * 获取所有表
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const page = (page, size, {tableName}) => {
    return httpRequest.get(`/generator/table/page/${page}/${size}`, {
        params: {
            tableName
        }
    });
}

/**
 * 代码生成 下载
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const generate = (tables) => {
    return httpRequest.download('code-generate.zip',"/generator/generate", {
        params: {
            tables: tables.join(',')
        }
    });
}